package com.ls.exception;

/**
 * @ClassName FengQuanException
 * @Description ls公共异常类（其他异常集成此类）
 * @Author TangQuanBin
 * @Date 2019/9/12 14:37
 * @Version 1.0
 **/
public class SysException extends RuntimeException {
    private int code;
    private String message;

    public SysException() {
        super();
        this.code = ErrorEnums.UNDEFINED_EXCEPTION.getCode();
        this.message = ErrorEnums.UNDEFINED_EXCEPTION.getMessage();
    }

    public SysException(String message) {
        super();
        this.code = ErrorEnums.UNDEFINED_EXCEPTION.getCode();
        this.message = message;
    }

    public SysException(int code, String message) {
        super();
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
    
    @Override
    public String toString() {
        return "code:" + code + ",message:" + message;
    }
}
